<% layout('/layouts/default.html', {title: '门店树表管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${text('门店树表管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('ajz:ajzCompanyInfo:edit')){ %>
					<a href="${ctx}/ajz/ajzCompanyInfo/form" class="btn btn-default btnTool" title="${text('新增门店树表')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${ajzCompanyInfo}" action="${ctx}/ajz/ajzCompanyInfo/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('营业执照名')}：</label>
					<div class="control-inline">
						<#form:input path="enterpriseName" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('营业执照号码')}：</label>
					<div class="control-inline">
						<#form:input path="enterpriseNum" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('联系人')}：</label>
					<div class="control-inline">
						<#form:input path="contactPerson" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('联系人电话')}：</label>
					<div class="control-inline">
						<#form:input path="contactPersonTel" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('地址')}：</label>
					<div class="control-inline">
						<#form:input path="addr" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('员工数量')}：</label>
					<div class="control-inline">
						<#form:input path="empCount" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('企业性质')}：</label>
					<div class="control-inline">
						<#form:input path="enterpriseType" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('隐患等级')}：</label>
					<div class="control-inline">
						<#form:input path="dangerLev" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('整改截止时间')}：</label>
					<div class="control-inline">
						<#form:input path="deadline" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text('营业执照名')}', name:'enterpriseName', index:'a.enterprise_name', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/ajz/ajzCompanyInfo/form?id='+row.id+'" class="btnList" data-title="${text('编辑门店树表')}">'+(val||row.id)+'</a>';
		}},
		{header:'${text('营业执照号码')}', name:'enterpriseNum', index:'a.enterprise_num', width:150, align:"left"},
		{header:'${text('联系人')}', name:'contactPerson', index:'a.contact_person', width:150, align:"left"},
		{header:'${text('联系人电话')}', name:'contactPersonTel', index:'a.contact_person_tel', width:150, align:"left"},
		{header:'${text('地址')}', name:'addr', index:'a.addr', width:150, align:"left"},
		{header:'${text('员工数量')}', name:'empCount', index:'a.emp_count', width:150, align:"left"},
		{header:'${text('企业性质')}', name:'enterpriseType', index:'a.enterprise_type', width:150, align:"left"},
		{header:'${text('隐患等级')}', name:'dangerLev', index:'a.danger_lev', width:150, align:"left"},
		{header:'${text('整改截止时间')}', name:'deadline', index:'a.deadline', width:150, align:"center"},
		{header:'${text('操作')}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('ajz:ajzCompanyInfo:edit')){ %>
				actions.push('<a href="${ctx}/ajz/ajzCompanyInfo/form?id='+row.id+'" class="btnList" title="${text('编辑门店树表')}"><i class="fa fa-pencil"></i></a>&nbsp;');
				actions.push('<a href="${ctx}/ajz/ajzCompanyInfo/delete?id='+row.id+'" class="btnList" title="${text('删除门店树表')}" data-confirm="${text('确认要删除该门店树表吗？')}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>